package com.qf.core.response;

import lombok.Getter;

/**
 * @Author: sin
 * @Date: 2025/5/5 14:19
 * @Description: 响应状态码
 **/
@Getter
public enum ResponseCode {
    SUCCESS(200, "SUCCESS"),
    ERROR(500, "ERROR"),
    LOGIN_ERROR(501, "登录失败"),
    VERIFY_CODE_ERROR(502, "验证码错误"),
    NO_LOGIN(401, "未登录"),
    NO_PERMISSION(403, "权限不足，请联系管理员!"),
    NO_ACCESS(504, "没有访问权限"),
    NO_DATA(505, "没有数据"),
    NO_EXIST(404, "资源不存在"),
    VALID_ERROR(1002, "参数校验失败"),
    //数据库操作错误码
    OPT_ERROR(1001, "数据库操作失败"),
    USERNAME_OR_PWD_ERROR(501, "用户名或密码错误"),
    GET_ENUM_FAILED(3, "获取枚举类型失败, 枚举类"),
    COMMON_BULK_DELETE_IDS_IS_INVALID(10003, "批量参数ID为空"),
    EXPORT_EXCEL_FAILED(10005, "excel导出失败"),
    UPLOAD_FILE_FAIL(10006, "上传文件失败"),
    FILE_TYPE_ERROR(10007, "只支持图片类型（JPG、PNG、GIF）"),
    OLD_PASSWORD_ERROR(10008, "旧密码错误"),
    GET_DATA_ERROR(10009, "获取数据异常"),
    UPLOAD_FILE_TYPE_ERROR(10010,"请上传图片类型文件");


    /**
     * 响应码
     */
    private final int code;

    /**
     * 响应描述
     */
    private final String desc;

    ResponseCode(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }
}
